# Makefile for test programs

export IN_SUBDIR = 1

TOP=/home/mika/irt-manhattan/mptcp_userland_0.1/src/demo

MAKE		= make
CC              = gcc -g
C++		= g++
OPT		= -O2 -D_REENTRANT -D__TEST_NO_CHECKSUMS -DULTCP
CFLAGS  = -shared -fPIC $(DEBUG) $(OPT) $(INCLUDES)
CFLAGS   += -I.. -DUSER_STACK `xml2-config --cflags`
CFLAGS-ATCP = -I.. -DUSER_STACK -DATCP

WARN		= 
# -Wall -Wno-unused
DEBUG		= -g -DNDEBUG

default: all

# end of $RCSFile$
LOADLIBES =  -lpthread `xml2-config --libs`

INCLUDES        = -I. -I$(TOP)/middleware/protocolMgr -I$(TOP)/middleware/connectionMgr -I$(TOP)/middleware/policyMgr/newPolicyManager -I$(TOP)/middleware/networkMgr

OBJECTS = socks.o ../middleware/protocolMgr/sine_socket.o ../middleware/connectionMgr/connectionMgr.o ../middleware/policyMgr/newPolicyManager/PolicyModel.o ../middleware/policyMgr/newPolicyManager/PolicyListener.o ../middleware/policyMgr/newPolicyManager/PolicyController.o ../middleware/networkMgr/nm.o

TARGETS = socks 

SRCS = socks.c ../middleware/protocolMgr/sine_socket.c ../middleware/connectionMgr/connectionMgr.c ../middleware/policyMgr/newPolicyManager/PolicyModel.cpp ../middleware/policyMgr/newPolicyManager/PolicyListener.cpp ../middleware/policyMgr/newPolicyManager/PolicyController.cpp ../middleware/networkMgr/nm.cpp

all: $(TARGETS)

$(TARGETS): $(OBJECTS)
	$(C++) $(LDFLAGS) $(OBJECTS) $(LOADLIBES) -o $@

clean:
	rm -f $(OBJECTS) $(TARGETS) *_tcp_kern* *~ core

depend:
	makedepend $(PROF) $(DEBUG) $(INCLUDES) -I.. $(SRCS)

# DO NOT DELETE THIS LINE -- make depend depends on it.

socks.o: ../middleware/protocolMgr/mptcpMgr.h
socks.o: ../middleware/policyMgr/policy.h

